#include <iostream>
#include <algorithm>
#include <list>
#include <string.h>

using namespace std;

int main () {

  list<string> mylist;
  string palabra;
  string final ("fin");

  int i=1;

  while (i=1){

      cout<<"Introduzca una palabra"<<endl;
      cin>>palabra;

      if (palabra.compare(final)!=0){

          mylist.push_back(palabra);

      }
      else if (palabra.compare(final)==0){

          i=0;
      }

  }

  mylist.sort();

  mylist.unique();

  cout << "mylist contains:";
  for (list<string>::iterator it=mylist.begin(); it!=mylist.end(); ++it)
    cout << " " << *it;
  cout << endl;


  return 0;
}

